<?php

namespace app\admin\validate;

use think\Validate;

class Grade extends Validate
{
    protected $rule = [
        'title'             => 'require|unique:grade',
        'pid'              => 'require',
    ];

    protected $message = [
        'title.require'     => '年级名称不能为空',
        'title.unique'      => '该年级已存在',
        'pid.require'    => '父类不能为空',
    ];
    protected $scene = [
        'edit'  => ['id','title', 'pid'],
        'add'  => ['title', 'pid'],
    ];
}


